<template>
  <div class='tinymceBox'>
    <h1 style="margin:0 0 10px 0">
      <el-row>
        <el-col :span="24" style="text-align:right">
           <i class="el-icon-error" style="background:#e6e6e6" @click="goBack"></i>
        </el-col>
      </el-row>
    </h1>
    <div>
      
      <el-row class="rowmagin">
        <el-col :span="3">姓名：{{name}}</el-col>
        <el-col :span="4">手机：{{tel}}</el-col>
        <el-col :span="4">咨询内容：{{server_tag}}</el-col>
        <el-col :span="3">生日：{{age}}</el-col>
        <el-col :span="8">到店时间：{{time}}</el-col>
      </el-row>
      <div class="rowmagin">情况登记：</div>
      <el-input  type="textarea" :rows="4" v-model="situation_registration" disabled style="width:75%"></el-input>
      <div class="rowmagin">医生建议：</div>
      <el-input  type="textarea" :rows="4" v-model="doctors_suggest" disabled style="width:75%"></el-input>
      <div class="rowmagin">图片信息：</div>
      
      <el-dialog :visible.sync="dialogVisible">
        <img width="100%" :src="dialogImageUrl" alt="">
      </el-dialog>

      <el-row>
        <el-col :span="24">
          <ul class="el-upload-list el-upload-list--picture-card">
            <li  :tabindex="index" class="el-upload-list__item is-success" v-for="(item,index) in fileList" :key="index">
              <img :src="item" alt="" class="el-upload-list__item-thumbnail">
              <span class="el-upload-list__item-actions">
                <span class="el-upload-list__item-preview" @click="shouimg(item)"><i class="el-icon-zoom-in"></i></span>
              </span>
            </li>
          </ul>
        </el-col>
      </el-row>
    </div>
   
  </div>
</template>

<script>
import Http from '@/Http/Http'
import getTime from '@/Http/getTime'

export default {
  props:['editData'],
  data () {
    return {
      
      dialogVisible: false,
      dialogImageUrl:'',
      name:'',
      fileList:['http://pdi2rfi8n.bkt.clouddn.com/Fug7zfrYWM-3F3vF1RPC81nQH1MP'],
      tel:'',
      server_tag:'',
      age:'',
      time:'',
      situation_registration:'',
      doctors_suggest:''
    }
  },

  computed: {
  },
  mounted () {
    
  },
  created() {
   
    if (this.editData) {
      this.name = this.editData.name;
      this.tel =  this.editData.tel
      this.server_tag = this.editData.server_tag;

      this.situation_registration = this.editData.situation_registration
      this.doctors_sugges = this.editData.doctors_sugges
      this.fileList = this.editData.imagesList
      const datas = new Date(this.editData.age);
      this.time = getTime(this.editData.time)
      this.age = datas.getFullYear();
    }
  },
  methods:{
   
   
     // 图片列表 方法  ----------------------
    shouimg(val){
      this.dialogVisible = true;
      this.dialogImageUrl = val;
    },
    
    goBack(){
      this.$emit('colseFun')
    },
  }
}
</script>
<style scoped>
.rowmagin{
  margin:15px 0 10px 0;
}
.tinymceBox{
  padding:5px;
}
</style>
